from tw.api import WidgetsList,CSSLink
from tw.forms import TableForm, TextField, TextArea,HiddenField,MultipleSelectField
from tg import url
from comboselect import ComboSelect
from kcbk import KCBK
from tw.forms.validators import All,NotEmpty,UnicodeString,Int

class ReminderForm(TableForm):
    template = "lifepyscle.widgets.templates.table_form"
    hover_help = True
    submit_text = "Add Reminder"
    class fields(WidgetsList):
        event_id = HiddenField(id='event_id',validator=All(NotEmpty(),Int()))
        message = TextArea(id="message",validator=UnicodeString(),label_text=u"Message:",\
                help_text=u"Custom message to the recipients of the reminder",\
                attrs=dict(rows=6, cols=45,style="width:60%"))
        trigger = TextField(id="trigger",validator=All(NotEmpty(),Int()),help_text=u'How many days before the event should the reminder be triggered?',
                    label_text=u'Trigger')
        #users_involved = MultipleSelectField(id="users_involved", label_text=u"Remindees:",options=[],\
        #        help_text=u"Available users are on the left. Select \
        #                    (ctrl-click to select multiple) users and move them to the right side. \
        #                    You can use a double click to move a user from left to right, or vice versa. If you do not choose\
        #                    any recipient, only you will receive the reminder")
        users_involved = KCBK(id="users_involved",label_text="Remindees",options=[])

reminder_form = ReminderForm("reminder_form",action=url('/reminder/add'))
